Kinetis SDK Demo Applications User Guide  1.0.0-beta
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
i2c_sim.h File Reference
#include "board.h"

Go to the source code of this file.

Macros

#define GPIO_SCL
 
#define GPIO_SDA
 

Functions

void i2c_gpio_init (int32_t speed, int32_t slaveaddr)
 Initialization. More...
 
uint8_t i2c_gpio_probe (uint8_t addr)
 Probe to see if a chip is present. Probe to see if a chip is present. Also good for checking for the completion of EEPROM writes since the chip stops responding until the write completes (typically 10mSec). More...
 
uint8_t i2c_gpio_read (uint8_t chip, uint32_t addr, int32_t alen, uint8_t *buffer, int32_t len)
 Read bytes. More...
 
uint8_t i2c_gpio_write (uint8_t chip, uint32_t addr, int32_t alen, uint8_t *buffer, int32_t len)
 Write bytes. More...
 

Macro Definition Documentation

#define GPIO_SCL

GPIO SCL

#define GPIO_SDA

GPIO SDA

Function Documentation

void i2c_gpio_init ( int32_t  speed,
int32_t  slaveaddr 
)
Parameters
[in]speedI2C speed.
[in]slaveaddrSlave device address.
uint8_t i2c_gpio_probe ( uint8_t  addr)
Parameters
[in]addrI2C slave device address.
Returns
Probe successful or failed.
uint8_t i2c_gpio_read ( uint8_t  chip,
uint32_t  addr,
int32_t  alen,
uint8_t *  buffer,
int32_t  len 
)

This function will read data from i2c slave device.

Parameters
[in]chipChip number.
[in]addrAddress in I2C slave device.
[in]alenAddress len.
[in]bufferBuffer address that will be read to.
[in]lenLen of data that will be read.
Returns
Read successful or not.
uint8_t i2c_gpio_write ( uint8_t  chip,
uint32_t  addr,
int32_t  alen,
uint8_t *  buffer,
int32_t  len 
)

This function will write data to i2c slave device.

Parameters
[in]chipChip address.
[in]addrAddress in I2C slave device.
[in]alenAddress len.
[in]bufferBuffer address that will be write.
[in]lenLen of data that will be write.
Returns
Write failed times.